<!DOCTYPE HTML>
<html xmlns:th="www.thymeleaf.org">
<head>
<title>尤洪商家注册</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="keywords" content="Novus Admin Panel Responsive web template, Bootstrap Web Templates, Flat Web Templates, Android Compatible web template, 
SmartPhone Compatible web template, free WebDesigns for Nokia, Samsung, LG, SonyEricsson, Motorola web design" />
<script type="application/x-javascript"> addEventListener("load", function() { setTimeout(hideURLbar, 0); }, false); function hideURLbar(){ window.scrollTo(0,1); } </script>
<!-- Bootstrap Core CSS -->
<link href="css/bootstrap.css" rel='stylesheet' type='text/css' />
<!-- Custom CSS -->
<link href="css/style.css" rel='stylesheet' type='text/css' />
<!-- font CSS -->
<!-- font-awesome icons -->
<link href="css/font-awesome.css" rel="stylesheet"> 
<!-- //font-awesome icons -->
 <!-- js-->
<script src="js/jquery-1.11.1.min.js"></script>
<script src="js/modernizr.custom.js"></script>
<!--webfonts-->
<link href='http://fonts.useso.com/css?family=Roboto+Condensed:400,300,300italic,400italic,700,700italic' rel='stylesheet' type='text/css'>
<!--//webfonts--> 
<!--animate-->
<link href="css/animate.css" rel="stylesheet" type="text/css" media="all">
<script src="js/wow.min.js"></script>
	<script>
		 new WOW().init();
	</script>
<!--//end-animate-->
<!-- Metis Menu -->
<script src="js/metisMenu.min.js"></script>
<script src="js/custom.js"></script>
<script src="js/jquery.form.js"></script>
<link href="css/custom.css" rel="stylesheet">
<!--//Metis Menu -->
</head> 
<body class="cbp-spmenu-push">
	<div class="main-content">
		<!-- main content start-->
		<div id="page-wrapper" style="margin: 0em 0 0 0em;padding: 1em 0em 0em;">
			<div class="main-page signup-page">
				<h3 class="title1">尤洪商家注册</h3>
				<p class="creating">我保证不发布违背法律、道德的商品！</p>
				<form action="toRegisterNow.do" method="post" id="registeBusiness" enctype="multipart/form-data">
					<div class="sign-up-row widget-shadow">
						<h5>个人信息 :</h5>
						<div class="sign-u" th:each="user:${user}">
							<div class="sign-up1">
								<h4>姓名&nbsp;* :</h4>
							</div>
							<div class="sign-up2">
									<input type="text" name="userName" th:value="${user.trueName}" id="name" disabled="disabled" required>
							</div>
							<div class="clearfix"> </div>
						</div>
						<div class="sign-u">
							<div class="sign-up1">
								<h4>手机号 *:</h4>
							</div>
							<div class="sign-up2">
									<input type="text" name="tel" id="tel" th:value="${user.tel}" disabled="disabled" required>
							</div>
							<div class="clearfix"> </div>
						</div>
						<div class="sign-u">
							<div class="sign-up1">
								<h4>邮箱地址&nbsp;* :</h4>
							</div>
							<div class="sign-up2">
									<input type="text" name="email" id="email" th:value="${user.email}" disabled="disabled" required>
							</div>
							<div class="clearfix"> </div>
						</div>
						<h5>商家信息 :</h5>
						<div class="sign-u">
							<div class="sign-up1">
								<h4>商家名&nbsp;* :</h4>
							</div>
							<div class="sign-up2">
								<input type="text" id="businessName" name="name" placeholder="请输入商家名" required="required">
							</div>
							<div class="clearfix"> </div>
						</div>
						<div class="sign-u">
							<div class="sign-up1">
								<h4>商家许可证&nbsp;* :</h4>
							</div>
							<div class="sign-up2">
								<input type="file" id="licence" name="licenceImage" required="required">
								<p class="help-block">请上传商家许可证</p><!-- 静态网页可添加 例图 功能 -->
							</div>
							<div class="clearfix"> </div>
						</div>
						<div class="sign-u">
							<div class="sign-up1">
								<h4>邮编&nbsp;* :</h4>
							</div>
							<div class="sign-up2">
									<input type="text" name="postal" id="postal" placeholder="邮编" required="required">
							</div>
							<div class="clearfix"> </div>
						</div>
						<div class="sign-u">
							<div class="sign-up1">
								<h4>所在地&nbsp;* :</h4>
							</div>
							<div class="sign-up2">
									<input type="text" name="addrName" id="addr" placeholder="所在地" required="required">
							</div>
							<div class="clearfix"> </div>
						</div>
						<div class="sign-u">
							<div class="sign-up1">
								<h4>商家描述&nbsp;* :</h4>
							</div>
							<div class="sign-up2">
								<input type="text" id="businessDescription" name="description" placeholder="请输入商家描述" required="required">
							</div>
							<div class="clearfix"> </div>
						</div>
						<h6>登陆信息 :</h6>
						<div class="sign-u">
							<div class="sign-up1">
								<h4>密码&nbsp;* :</h4>
							</div>
							<div class="sign-up2">
									<input type="password" name="pwd" placeholder="请输入用户密码" required id="pwd" >
							</div>
							<div class="clearfix"> </div>
						</div>
						<div class="sign-u">
							<div class="sign-up1">
								<h4>邮箱验证码&nbsp;* :</h4>
							</div>
							<div class="sign-up2">
									<input type="text" style="width: 70%;" name="businessRegisterInputCode" placeholder="请输入邮箱验证码" required id="email_word">
									<!-- 点击发送后，此按钮进入1分钟倒计时 -->
									<button type="button" class="btn btn-lg" onclick="sendBusinessRegisterEmail(60000)" id="businessRegisterSendEmailButton">点击发送</button>
									
							</div>
							<div class="clearfix"> </div>
						</div>
						<div class="sub_home">
							<input type="submit" value="注册商家" style="margin: 0.5em 0 0 24em;" class="register_business">
							<div class="clearfix"> </div>
						</div>
					</div>
				</form>
			</div>
		</div>
		<!-- 消息提示框 -->
		<div class="col-md-4 modal-grids">
		<button type="button" id="asdf" class="btn btn-primary" data-toggle="modal" data-target=".bs-example-modal-sm" style="display: none;">Small modal</button>
			<div class="modal fade bs-example-modal-sm" tabindex="-1" role="dialog" aria-labelledby="mySmallModalLabel">
				<div class="modal-dialog modal-sm">
					<div class="modal-content"> 
						<div class="modal-header">
							<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
							<h4 class="modal-title" id="mySmallModalLabel">温馨提示</h4> 
						</div> 
						<div class="modal-body" id="tipContent"> Cras purus odio, vestibulum in vulputate at, tempus viverra turpis.
						</div>
					</div>
				</div>
			</div>
		</div>
		<!-- //消息提示框 -->
		<!--footer-->
		<div class="footer" style="padding: 0.5em;">
		   <p>Copyright &copy; 2016.Company name All rights reserved.<a target="_blank" href="http://sc.chinaz.com/moban/">&#x7F51;&#x9875;&#x6A21;&#x677F;</a></p>
		</div>
        <!--//footer-->
	</div>
	<!-- Classie -->
	
	<script type="text/javascript">
	function sendBusinessRegisterEmail(time){
		$('#businessRegisterSendEmailButton').attr('disabled','disabled');
	    setTimeout(function() {
	        var x = setInterval(function(){
	                time= time - 1000; //reduce each second
	                $('#businessRegisterSendEmailButton').css('width','170px');
	                $('#businessRegisterSendEmailButton').html((time/1000)%60+'秒后可重新发送');
	                if(time==0){
	                        clearInterval(x);
	                        $('#businessRegisterSendEmailButton').css('width','118px');
	                        $('#businessRegisterSendEmailButton').html('点击发送');
	                        $('#businessRegisterSendEmailButton').removeAttr('disabled');
	                }
	        }, 1000);
	    }, 1000);
	    
		$.post('sendBusinessRegisterEmail.do',function(data){
			if(data.sucess==0){
				$('#tipContent').html(data.message);
            	$("#asdf").trigger('click');
			}
		});
	}
	
	$(function(){
		$("#registeBusiness").submit(function(){ 
	       	var options ={
	       			dataType: 'json',
	       			headers : {"ClientCallMode" : "ajax"}, //添加请求头部
	       			success: function(data){
	       				if(data.sucess==0){
	       					$('#name').html('');
	       					$('#tel').html('');
	       					$('#email').html('');
	       					$('#licence').html('');
	       					$('#addr').html('');
	       					$('#pwd').html('');
	   	                	$('#tipContent').html(data.message);
	   	                	$("#asdf").trigger('click');
	   	                }else if(data.sucess==1){
	   	                	window.location.href='toLogin.do';
	   	                }
	       			}
	       	};
           $('#registeBusiness').ajaxSubmit(options); 
           return false;   //防止表单自动提交
	    });
	});
	</script>
	
	<script src="js/classie.js"></script>
	<!--scrolling js-->
	<script src="js/jquery.nicescroll.js"></script>
	<script src="js/scripts.js"></script>
	<!--//scrolling js-->
	<!-- Bootstrap Core JavaScript -->
	<script src="js/bootstrap.js"> </script>
	
	<script type="text/javascript">
	
	</script>
</body>
</html>